package Thread;
/**
 * Time 20206.24
 * */
public class Thread extends java.lang.Thread {
    private String name;

    public Thread(String name){
        this.name = name;
    }
    public void run(){
        for (int i = 0; i < 5; i++){
            System.out.println(name + "运行 :" + i );
        }
        try{
            sleep((int) Math.random() *10);
        }catch(InterruptedException e){
            e.printStackTrace();
        }
    }
}
class Main{
    public static void main(String[] args){
        Thread mth1 = new Thread("A");
        Thread mth2 = new Thread("B");
        mth1 .start();
        mth2.start();
    }
}